<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<script type="text/javascript">
    // 如果产生了错误，只需要使用try语句
    try{
        xxx();
    } catch(e) {
        alert(e.name + ':' + e.message);
    } finally {
        alert('OK');
    }
</script>
</body>
</html>
